package com.ludomancy.breathe;

import java.util.Iterator;
import java.util.Vector;

public class Game
{
	public static Game game;
	
	private Bruno bruno;
	public Vector options = new Vector();
	private String mainText;

	public Game()
	{
		game = this;
		// init level
		bruno = new Bruno();
		// bruno comes because of the nightmares (public info) 
		options.add(new Option(bruno.nightmares));
	}
	
	public String getMainText()
	{
		return mainText;
	}
	
	public void update()
	{
	}
	
	public boolean hasOption(Option option)
	{
		for (Iterator iter = options.iterator(); iter.hasNext();)
		{
			Option opt = (Option) iter.next();
			if(opt.node.equals(option.node))
			{
				return true;
			}
		}
		return false;
	}
	
	public void addOption(Option option)
	{
		if(!hasOption(option))
		{
			options.add(option);
		}
	}

	public void chooseOption(Option option)
	{
		mainText = bruno.processOption(option);
		mainText += "\n \n \n";
		mainText += "["+bruno.getObservation()+"]";
		BreatheApp.mainWidget.options.changeOptions(options);
	}
}
